From: tsteven4 Date: Sun, 27 Dec 2015 16:51:09 +0000 (-0700) Subject: fix bug in xml_parse_time. we failed to carry any result from adding the time offset... X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~10^2~7^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=80899071cf5c7ca1c34e6b9bddab4295a6cc3789;p=gpsbabel.git fix bug in xml_parse_time. we failed to carry any result from adding the time offset to the date. --- diff --git a/gpx.cc b/gpx.cc index 0a62edd8b..e5fa054c1 100644 --- a/gpx.cc +++ b/gpx.cc @@ -862,16 +862,15 @@ xml_parse_time(const QString& dateTimeString) if (res > 0) { QDate date(year, mon, mday); QTime time(hour, min, sec); + dt = QDateTime(date, time, Qt::UTC); // Fractional part of time. if (fsec) { - time = time.addMSecs(lround(fsec * 1000)); + dt = dt.addMSecs(lround(fsec * 1000)); } // Any offsets that were stuck at the end. - time = time.addSecs(-off_sign * off_hr * 3600 - off_sign * off_min * 60); - - dt = QDateTime(date, time, Qt::UTC); + dt = dt.addSecs(-off_sign * off_hr * 3600 - off_sign * off_min * 60); } else { dt = QDateTime(); }